package com.dongjiantong.farmrecords.service;

import com.dongjiantong.common.web.sso.LoginInfo;
import com.dongjiantong.farmrecords.dto.CowRecordDto;
import com.dongjiantong.farmrecords.model.FarmRecordsCowRecords;
import com.dongjiantong.mybatis.BaseService;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * @author Lee
 * @date 2018/1/9
 */
public interface FarmRecordsCowRecordsService extends BaseService<FarmRecordsCowRecords> {
    /**
     * 新建牛档案
     * @param farmRecordsBullRecords
     * @param toStatus
     * @return
     */
    Map<String,Object> createOne(LoginInfo loginInfo, FarmRecordsCowRecords farmRecordsBullRecords, Integer toStatus);

    /**
     * 养殖端
     * 根据提交状态分页查询列表
     * @param farmId
     * @param status
     * @return
     */
    PageInfo<CowRecordDto> selectListByStatus(Integer pageNum, Integer pageSize, List<Integer> status, Long farmId, String cowNumber);

    /**
     * 政府端分页查看牛档案
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<FarmRecordsCowRecords> selectByMap(Integer pageNum, Integer pageSize, Map map);

    /**
     * 设置返回cowRecordDto包装类
     * @param farmRecordsCowRecordsList
     * @return
     */
    List<CowRecordDto> setCowRecordsDto(List<FarmRecordsCowRecords> farmRecordsCowRecordsList);
    /**
     * 更新牛档案
     * @param farmRecordsBullRecords
     * @param toStatus
     * @return
     */
    Integer updateByIdOrNumber(FarmRecordsCowRecords farmRecordsBullRecords, Integer toStatus);

    /**
     * 删除牛档案
     */
    Integer deleteById();

    /**
     * 更新牛档案耳标
     * @param earTagNumber 当前耳标
     * @param beforeEarTogNumber 原有耳标
     * @return
     */
    Boolean updateEarNumber(String earTagNumber,String beforeEarTogNumber);
}
